#include "Auto.h"

//Window structure
	
	Window::Window() { h = NULL; }

	void Window::pos()
	{
		GetWindowRect(h, &rect);
	}

	bool Window::find(LPCWSTR className, LPCWSTR titleName)
	{
		h = FindWindow(className, titleName);
		if (h)
		{
			Window::pos();
			return true;
		}
		return false;
	}
	
	bool Window::switchup()
	{
		sleep(200);
		SwitchToThisWindow(h, true);
		if (GetForegroundWindow() == h)return true;
		return false;
		
	}
	bool Window::switchdown()
	{
		sleep(200);
		ShowWindow(h, SW_MINIMIZE);
		if (GetForegroundWindow() == h)return false;
		return true;
	}